<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <!-- 
    v-if 
    v-else
    v-else-if

    这些指令都是加在标签上的
    如果if条件成立则添加v-if的标签显示在页面上，如果不成立则看第二个条件成立则显示在页面，不成立则继续往后判断

   -->
  <div id="app">
    <!-- <div v-if="score >= 90">优秀</div>
    <div v-else-if="score >= 80">良好</div>
    <div v-else-if="score >= 60">及格</div>
    <div v-else>不及格</div> -->

    <div>
      <i v-if="topic.top">置顶</i>
      <i v-else-if="topic.good">精华</i>
      <h3>{{topic.title}}</h3>
    </div>
  </div>
  <script src="./vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        // score: 59
        topic: {
          "id": "5ba5fd6237a6965f59051bd1",
          "author_id": "4f447c2f0a8abae26e01b27d",
          "title": "EggJS 10000 Star + 2 years - 阿里 Node 企业级框架 ✨✨✨",
          "tab": "share",
          "last_reply_at": "2018-11-13T03:10:35.072Z",
          "good": true,
          "top": true,
          "reply_count": 54,
          "visit_count": 9946,
          "create_at": "2018-09-22T08:29:22.948Z",
          "author": {
            "loginname": "atian25",
            "avatar_url": "https://avatars2.githubusercontent.com/u/227713?v=4&s=120"
          }
        }
      }
    })
  </script>
</body>
</html>